package pl.edu.uj.tcs.blef.utils;

public abstract class AbstractColor implements Color {
	
	@Override
	public int compareTo(Color o) {
		if(this.getPriority() < o.getPriority()) return -1;
		else if(this.getPriority() == o.getPriority()) return 0;
		else return -1;
	}
	
	@Override
	public boolean equals(Object o){
		if(o == null) return false;
		if(!(o instanceof Color)) return false;
		Color c = (Color)o;
		if(this.getCode().equals(c.getCode())) return true;
		else return false;
	}
	
	@Override
	public int hashCode(){
		return this.getCode().hashCode();
	}

	@Override
	public abstract String getCode();
	
	@Override
	public abstract int getPriority();
}
